#include <iostream>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
using namespace std; 

void handle(int s){

}
 int main(){
	 sigset_t mask; 
	 sigset_t oldmask;
	 sigemptyset(&mask);
	 sigemptyset(&oldmask); 
	 sigaddset(&mask,SIGUSR2);
	 cout << "pid: " << getpid() << endl;
	 int r =  sigprocmask(SIG_SETMASK,&mask,0); 
	 cout << r << endl; 
	 sleep(10); 
	 r = sigprocmask(SIG_SETMASK,&oldmask,0); 
	 cout << r << endl; 
	 cout << " 解除屏蔽,查看信号发生的情况\n"; 

	 while(1){
		cout << "hello" << endl; 
		sleep(1); 
	 }

	 
 }
